package com.ksyun.cloudhostalarmprocessing.service;

import com.ksyun.cloudhostalarmprocessing.common.QueryRequest;
import com.ksyun.cloudhostalarmprocessing.common.QueryResponse;
import com.ksyun.cloudhostalarmprocessing.common.Request;
import com.ksyun.cloudhostalarmprocessing.entity.Metrics;
import com.ksyun.cloudhostalarmprocessing.entity.vo.MetricsDataVO;
import com.ksyun.cloudhostalarmprocessing.entity.vo.MetricsVO;
import com.ksyun.cloudhostalarmprocessing.entity.vo.RateVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author 李厚航
 * @since 2024-05-07
 */
public interface IMetricsService{

    /**
     * 将指标信息存储在数据库中
     * @param request
     * @return
     */
    void add(List<Request> request);

    List<MetricsVO> selectLatest(@Param("beginTime") String beginTime, @Param("endTime") String endTime);

    RateVO selectRate(@Param("beginTime") String beginTime, @Param("endTime") String endTime);

    List<Metrics> selectAll(Integer page,Integer size);

    Integer selectCount();

    /**
     * 根据时间段获取数据
     * @return
     */
    QueryResponse<MetricsDataVO> getByTimestamp(QueryRequest queryRequest);
}
